﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<script language="c#" runat="server">
protected string CurrentCategoryID
{
	get
	{
		if (!String.IsNullOrEmpty(Request.QueryString["CategoryID"]) && Request.QueryString["CategoryID"] != Guid.Empty.ToString())
			return Request.QueryString["CategoryID"];
		else if (Request.Cookies["CategoryID"] != null && Request.Cookies["CategoryID"].Value != Guid.Empty.ToString())
			return Request.Cookies["CategoryID"].Value;
		else
			return "";
	}
}
</script>
<section data-page="menu_add" data-title="添加菜单" data-lang="<%=ContentLang%>">
	<dl class="path1">
		<dt><span>您的位置：</span>添加菜单</dt>
		<dd>
			<select data-class="<%=ContentLang%>Font" data-ali-widget="combo">
				<ali:List Object="Language" Source="Manager.Languages">
					<ali:Record>
						<%If Convert.ToString(Ab) == ContentLang%>
							<option value="<%=Ab%>" selected><%=[AliCMS.SystemModule.Alias.Language.Name + PageLang]%></option>
						<%Else%>
							<option value="<%=Ab%>"><%=[AliCMS.SystemModule.Alias.Language.Name + PageLang]%></option>
						<%EndIf%>
					</ali:Record>
				</ali:List>
			</select>
		</dd>
	</dl>
	<form action="" class="post">
		<div class="post-body">
			<div class="ali-tabs" data-event="click">
				<div class="ali-tabs-header">
					<div class="ali-tabs-nav-container">
						<ul>
							<li><a href="list.aspx?Lang=<%=ContentLang%>" target="ali-navtab">菜单列表</a></li>
							<li class="ali-active"><a>添加菜单</a></li>
							<li><a href="../menu_category/list.aspx?Lang=<%=ContentLang%>" target="ali-navtab">类别列表</a></li>
							<li><a href="../menu_category/add.aspx?Lang=<%=ContentLang%>" target="ali-navtab">添加类别</a></li>
						</ul>				
					</div>
				</div>
				<div class="ali-tabs-body">
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel">
						<table class="post-table margin2">
							<tr>
								<th width="120">名称：</th>
								<td>
									<input type="text" name="Name" size="60" maxlength="255" class="ali-input ali-input-required <%=ContentLang%>Font">
									<label><input type="checkbox" data-name="Bold">粗体</label>
									<label><input type="checkbox" data-name="Italic">斜体</label>
									颜色：<button type="button" data-name="Color" size="8" class="color-selector"></button>
									<label><input type="checkbox" data-name="Custom">自定</label>
									<br>
									<input type="text" data-name="CustomStyle" size="60" style="display:none" class="ali-input">
									<label><input type="checkbox" data-operation="CheckGuid">Guid：</label><input type="text" name="ID" size="40" maxlength="40" disabled class="ali-input ali-disabled">
								</td>
							</tr>
							<tr>
								<th>类别：</th>
								<td>
									<select name="CategoryID" data-tree="true" data-root="" data-ali-widget="combo" data-class="<%=ContentLang%>Font">
										<option data-item="" data-parent="" value="">公共菜单</option>
										<ali:Tree Object="MenuCategory">
											<ali:Record>
												<%If Convert.ToString(ID) == CurrentCategoryID%>
													<option data-item="<%=InnerID%>" data-parent="<%=ParentInnerID%>" value="<%=ID%>" selected><%=Name%></option>
												<%Else%>
													<option data-item="<%=InnerID%>" data-parent="<%=ParentInnerID%>" value="<%=ID%>"><%=Name%></option>
												<%EndIf%>
												<%=ChildRecords%>
											</ali:Record>
										</ali:Tree>		
									</select>
								</td>
							</tr>
							<tr>
								<th>父菜单：</th>
								<td>
									<select name="ParentID" data-tree="true" data-root="" data-ali-widget="combo" data-class="<%=ContentLang%>Font">
										<option data-item="" data-parent="" value="">未指定</option>
										<ali:Tree Object="Menu" Condition="CategoryID=CurrentCategoryID">
											<ali:Record>
												<option data-item="<%=InnerID%>" data-parent="<%=ParentInnerID%>" value="<%=ID%>"><%=Name%></option>
												<%=ChildRecords%>
											</ali:Record>
										</ali:Tree>		
									</select>
								</td>
							</tr>
							<tr>
								<th>链接地址：</th>
								<td>
									<label><input type="radio" name="LinkType" value="Content" checked class="ali-input">内容</label>
									<label><input type="radio" name="LinkType" value="InnerLink" class="ali-input">站内链接</label>
									<label><input type="radio" name="LinkType" value="OuterLink" class="ali-input">站外链接</label>
									<br />
									<span name="ChannelIDSpan" style="display:none">
										栏目：
										<select name="ChannelID" data-class="<%=ContentLang%>Font" data-tree="true" data-root="" data-ali-widget="combo">
											<ali:Tree Object="Channel">
												<ali:Record>
													<option data-item="<%=InnerID%>" data-parent="<%=ParentInnerID%>" value="<%=ID%>"><%=Name%></option>
													<%=ChildRecords%>
												</ali:Record>
											</ali:Tree>		
										</select>
									</span>
									<input type="text" name="Path" size="35" maxlength="255" class="ali-input" style="display:none"><span name="PathTip" style="display:none">如果扩展名.ext，则表示与栏目设置一致</span>
									<div data-name="Page" style="display:none"><br>
										自定模板：<input type="text" name="PageTemplate" class="ali-input">可以空<br>
										页面标识：<input type="text" data-name="PageID" class="ali-input">
										<select data-name="PageIDCandidate" data-ali-widget="combo">
											<option>预定义</option>
											<option value="{ID}">ID</option>
											<option value="{Guid}">Guid</option>
										</select>可以空<br />
									</div>
								</td>
							</tr>
							<tr>
								<th>目标窗口：</th>
								<td>
									<select name="Target" data-ali-widget="combo">
										<option value="_self">在原窗口打开(_self)</option>
										<option value="_top">在顶层窗口打开(_top)</option>
										<option value="_parent">在父窗口打开(_parent)</option>
										<option value="_blank">在新窗口打开(_blank)</option>
									</select>
								</td>
							</tr>
							<tr>
								<th>类型：</th>
								<td>
									<select name="Type" data-ali-widget="combo">
										<option value="Text">文本</option>
										<option value="Picture">图片</option>
										<option value="Audio">音频</option>
										<option value="Video">视频</option>
										<option value="Flash">Flash</option>
										<option value="File">文件</option>
									</select>
								</td>
							</tr>
							<tr data-name="ThumbnailRow" style="display:none">
								<th>缩略图：</th>
								<td><input type="text" name="Thumbnail" size="60" class="ali-input"><a class="ali-button ali-uploader">浏览...</a><a data-operation="SelectThumbnail" class="ali-button">选择</a></td>
							</tr>
							<tr data-name="FileRow" style="display:none">
								<th>文件：</th>
								<td>
									<input type="text" name="File" size="60" class="ali-input">
									<select name="PlayerID" data-class="<%=ContentLang%>Font" data-ali-widget="combo">
										<option value="">-- 智能播放器 --</option>
										<optgroup label="操作">
											<option value="parse1">普通分析</option>
											<option value="parse2">高级分析</option>
										</optgroup>
										<optgroup label="播放器">
											<ali:List Object="Player">
												<ali:Record>
													<option value="<%=ID%>"><%=Name%></option>
												</ali:Record>
											</ali:List>
										</optgroup>
									</select>
									<a class="ali-button ali-uploader">浏览...</a>
								</td>
							</tr>
							<tr>
								<th>是否显示：</th>
								<td>
									<label><input type="radio" name="IsDisplay" value="true" checked>是</label>
									<label><input type="radio" name="IsDisplay" value="false">否</label>
								</td>
							</tr>
							<tr data-name="HtmlEditorTR">
								<th>内容：</th>
								<td>
									<textarea name="Content" data-instance="<%=InstanceID%>" class="editor"></textarea>
								</td>
							</tr>
							<tr>
								<th>样式类名：</th>
								<td>
									<input type="text" name="Class" size="20" maxlength="20" class="ali-input">
								</td>
							</tr>
							<tr>
								<th>指标：</th>
								<td>
									人气：<input type="text" name="HitCount" value="0" size="10" maxlength="255" class="ali-input">
									下载：<input type="text" name="DownCount" value="0" size="10" maxlength="255" class="ali-input">
								</td>
							</tr>
						</table>
					</div>
				</div>
				<div class="ali-tabs-bottom"><b></b></div>
			</div>
		</div>
		<div class="post-footer"><button type="submit" class="ali-button">添 加</button><input type="hidden" name="PictureAllowedType" value="gif|jpg|jpeg|png|bmp|png"></div>
	</form>
</section>